home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat2 / standard / brk.z / brk
Encoding:
Text File  |  2002-10-03  |  4.2 KB  |  133 lines

  1.  
  2.  
  3.  
  4. bbbbrrrrkkkk((((2222))))                                                                  bbbbrrrrkkkk((((2222))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      brk, sbrk - change data segment space allocation
  10.  
  11. CCCC SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ####iiiinnnncccclllluuuuddddeeee <<<<uuuunnnniiiissssttttdddd....hhhh>>>>
  13.  
  14.      iiiinnnntttt bbbbrrrrkkkk ((((vvvvooooiiiidddd ****eeeennnnddddddddssss))));;;;
  15.  
  16.      vvvvooooiiiidddd ****ssssbbbbrrrrkkkk ((((ssssssssiiiizzzzeeee____tttt iiiinnnnccccrrrr))));;;;
  17.  
  18. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  19.      _bbbb_rrrr_kkkk and _ssss_bbbb_rrrr_kkkk are used to change dynamically the amount of space allocated
  20.      for the calling process's data segment [see _eeee_xxxx_eeee_cccc(2)].  The change is made
  21.      by resetting the process's break value and allocating the appropriate
  22.      amount of space.  The break value is the address of the first location
  23.      beyond the end of the data segment.  The amount of allocated space
  24.      increases as the break value increases.  Newly allocated space is set to
  25.      zero.  If, however, the same memory space is reallocated to the same
  26.      process its contents are undefined.
  27.  
  28.      _bbbb_rrrr_kkkk sets the break value to _e_n_d_d_s and changes the allocated space
  29.      accordingly.
  30.  
  31.      _ssss_bbbb_rrrr_kkkk adds _i_n_c_r bytes to the break value and changes the allocated space
  32.      accordingly.  _i_n_c_r can be negative, in which case the amount of allocated
  33.      space is decreased.
  34.  
  35.      _bbbb_rrrr_kkkk and _ssss_bbbb_rrrr_kkkk will fail without making any change in the allocated space
  36.      if one or more of the following are true:
  37.  
  38.           _EEEE_NNNN_OOOO_MMMM_EEEE_MMMM       Such a change would result in more space being
  39.                        allocated than is allowed by the system-imposed maximum
  40.                        process size [see _uuuu_llll_iiii_mmmm_iiii_tttt(2)].
  41.  
  42.           _EEEE_AAAA_GGGG_AAAA_IIII_NNNN       Total amount of system memory available for a read
  43.                        during physical IO is temporarily insufficient [see
  44.                        _ssss_hhhh_mmmm_oooo_pppp(2)].  This may occur even though the space
  45.                        requested was less than the system-imposed maximum
  46.                        process size [see _uuuu_llll_iiii_mmmm_iiii_tttt(2)].
  47.  
  48. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  49.      _eeee_xxxx_eeee_cccc(2), _ssss_hhhh_mmmm_oooo_pppp(2), _uuuu_llll_iiii_mmmm_iiii_tttt(2), _eeee_nnnn_dddd(3C).
  50.  
  51. CCCCAAAAVVVVEEEEAAAATTTTSSSS
  52.      _ssss_bbbb_rrrr_kkkk(2) is not multithreaded.  Simultaneous _ssss_bbbb_rrrr_kkkk calls with positive
  53.      increments will return the same value.  It is recommended that _mmmm_aaaa_llll_llll_oooo_cccc_((((_2222_))))
  54.      be used instead of _ssss_bbbb_rrrr_kkkk_((((_2222_)))).
  55.  
  56. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  57.      Upon successful completion, _bbbb_rrrr_kkkk returns a value of 0 and _ssss_bbbb_rrrr_kkkk returns the
  58.      old break value.  Otherwise, a value of -1 is returned and _eeee_rrrr_rrrr_nnnn_oooo is set
  59.      to indicate the error.
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. bbbbrrrrkkkk((((2222))))                                                                  bbbbrrrrkkkk((((2222))))
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.                                                                         PPPPaaaaggggeeee 2222
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.